using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows.Forms;

namespace ukapi_file_generation
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string s = this.tbFileContent.Text.Replace("{NAME}", this.tbName.Text);
            s = s.Replace("{INCLUDE}", this.tbInclude.Text + ".h");
            s = s.Replace("{FUNCTION}", this.tbFunction.Text);

            FileStream fs = new FileStream(this.tbFileName.Text + ".c", FileMode.Create);
            fs.Write(Encoding.ASCII.GetBytes(s), 0, Encoding.ASCII.GetByteCount(s));
            fs.Close();
        }
    }
}